<?php

namespace  Aitels\Foundation\Config;

use  Aitels\Foundation\Annotation\ApplicationAnnotationsContainer;
use  Aitels\Foundation\Annotation\ConfigAnnotation;


class AnnotationConfigRegister
{
    public function register($app){
        foreach (ApplicationAnnotationsContainer::getApplicationAnnotations(ConfigAnnotation::NAME) as $classFile => $methodsConfigs) {
            foreach ($methodsConfigs as $methodName => $configs) {
                foreach ($configs as $config) {
                    foreach ($config as $k => $v) {
                        $app->get('config')->set($k, $v);
                    }
                }
            }
        }
    }

}